import { reactive } from "vue";
export const useColumns = () => {
  // 表格列的配置
  const columns = reactive([
    {
      title: "论坛id",
      dataIndex: "id",
      key: "id",
      width: 80,
    },
    {
      title: "用户id",
      dataIndex: "user_id",
      key: "user_id",
      width: 80,
    },
    {
      title: "用户",
      key: "username",
      slots: { customRender: "username" },
    },
    {
      title: "标题",
      dataIndex: "title",
      key: "title",
    },
    {
      title: "内容",
      dataIndex: "content",
      key: "content",
      width: 250,
      ellipsis: true,
    },
    {
      title: "创建时间",
      dataIndex: "createtime",
      key: "createtime",
      width: 170,
    },
    {
      title: "操作",
      key: "operation",
      slots: { customRender: "operation" },
    },
  ]);

  return {
    columns,
  };
};
